package com.lemon.cloud.gray;

import com.lemon.cloud.gray.feign.GrayFeignRequestInterceptor;
import com.lemon.cloud.gray.feign.GrayFeignResponseInterceptor;
import com.lemon.cloud.gray.rule.GrayLoadConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

/**
 * 需要开启灰度发布
 */
@Configuration
@Component
@ConditionalOnProperty(value = "gray.rule.enabled", havingValue = "true")
@LoadBalancerClients(defaultConfiguration = GrayLoadConfiguration.class)
@Import({GrayFeignRequestInterceptor.class, GrayFeignResponseInterceptor.class})
public class GrayLoadBalancerAutoConfiguration {

}
